<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>jquery ajax异常处理</title>
        <script src="./jquery.min.js"></script>
	</head>
	<body>
        <button >发送get消息</button>
        <button >发送post请求</button>
        <button >通用请求</button>
	</body>
	<script type="text/javascript">
        
        btns[0].addEventListener('click',()=>{
            // $.get();
        });
        btns[1].addEventListener('click',function(){
            // $.post()
        });
        btns[2].addEventListener('click',function(){
            $.ajax({
                url:'',
                type:'POST',
                dataType:'json',
                success:function(data){
                    console.log(data);
                },
                timeout:2000,
                error:function(){
                    //出错
                },
                //头信息
                headers:{

                }
            })
        });
        

    </script>
</html>